package com.compass.doctor.ui.patient.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.R
import com.compass.doctor.databinding.LayoutHospitalizedRecordItemBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.glide.setUrlCircle
import com.compass.framework.model.HospitalizedLog
import com.compass.framework.utils.DateUtils
import com.compass.framework.utils.getDrawableResource

/**
 * Description： 患者住院记录adapter
 * Date:2024/2/1 14:35
 */
class PatientHospitalizedAdapter: BaseRecyclerViewAdapter<HospitalizedLog, LayoutHospitalizedRecordItemBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutHospitalizedRecordItemBinding>,
        item: HospitalizedLog?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvDiagnosis.text = item.departmentName
            tvSeeDoctorTime.text = DateUtils.conversionTime(item.createTime, DateUtils.FORMAT_TWO)


        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutHospitalizedRecordItemBinding {
        return LayoutHospitalizedRecordItemBinding.inflate(layoutInflater, parent, false)
    }
}